import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 组件懒加载机制
// http://router.vuejs.org/zh-cn/advanced/lazy-loading.html
const routes = [
  {
    path: '/',
    component: (resolve) => require(['../App.vue'], resolve),
  },
  {
    path: '/rentMode',
    component: (resolve) => require(['../views/RentMode.vue'], resolve)
  },
  {
    path: '/rentHistory',
    component: (resolve) => require(['../views/RentHistory.vue'], resolve)
  },
  {
    path: '/payOrder',
    component: (resolve) => require(['../views/PayOrder.vue'], resolve)
  },
  {
    path: '/rentStatus',
    component: (resolve) => require(['../views/RentStatus.vue'], resolve)
  },
  {
    path: '/rentOrder',
    component: (resolve) => require(['../views/RentOrder.vue'], resolve)
  },
  {
    path: '/*',
    redirect: '/'
  }
]

export default new VueRouter({ routes })
